import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { Nyt7PlotDetailInfoVO, Nyt7PlotDetailInfoForm, Nyt7PlotDetailInfoQuery } from '@/api/Nyt7PlotDetailInfo/Nyt7PlotDetailInfo/types';

/**
 * 查询地块详细信息列表
 * @param query
 * @returns {*}
 */

export const listNyt7PlotDetailInfo = (query?: Nyt7PlotDetailInfoQuery): AxiosPromise<Nyt7PlotDetailInfoVO[]> => {
  return request({
    url: '/Nyt7PlotDetailInfo/Nyt7PlotDetailInfo/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询地块详细信息详细
 * @param id
 */
export const getNyt7PlotDetailInfo = (id: string | number): AxiosPromise<Nyt7PlotDetailInfoVO> => {
  return request({
    url: '/Nyt7PlotDetailInfo/Nyt7PlotDetailInfo/' + id,
    method: 'get'
  });
};

/**
 * 新增地块详细信息
 * @param data
 */
export const addNyt7PlotDetailInfo = (data: Nyt7PlotDetailInfoForm) => {
  return request({
    url: '/Nyt7PlotDetailInfo/Nyt7PlotDetailInfo',
    method: 'post',
    data: data
  });
};

/**
 * 修改地块详细信息
 * @param data
 */
export const updateNyt7PlotDetailInfo = (data: Nyt7PlotDetailInfoForm) => {
  return request({
    url: '/Nyt7PlotDetailInfo/Nyt7PlotDetailInfo',
    method: 'put',
    data: data
  });
};

/**
 * 删除地块详细信息
 * @param id
 */
export const delNyt7PlotDetailInfo = (id: string | number | Array<string | number>) => {
  return request({
    url: '/Nyt7PlotDetailInfo/Nyt7PlotDetailInfo/' + id,
    method: 'delete'
  });
};


/**
 * 获取所有地块详细信息
 * @returns {*}
 */
export const getAllNyt7PlotDetailInfo = (): AxiosPromise<Nyt7PlotDetailInfoVO[]> => {
  return request({
    url: '/Nyt7PlotDetailInfo/Nyt7PlotDetailInfo/list',
    method: 'get'
  });
};






/**
 * 导出选中的地块详细信息列表
 * @param ids
 */
export const exportSelected = (ids: number[]): AxiosPromise<Blob> => {
  return request({
    url: '/Nyt7PlotDetailInfo/Nyt7PlotDetailInfo/exportSelected',
    method: 'post',
    data: ids,
    responseType: 'blob'
  });
};
